package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.domian.UserLogin;
import com.itheima.service.UserLoginService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author althle
 * @create 08-24-14:34
 * @功能
 * @注释
 */

@Controller
@RequestMapping("/loginuser")
@ResponseBody
public class LoginController {

    @Reference
    private UserLoginService userLoginService;



    @RequestMapping("/findOne")
    public UserLogin Login( String username, String password){
        return userLoginService.findOne(username,password);
    }


    @RequestMapping("/findAll")
    public List<UserLogin> findAll(){
        return  userLoginService.findAll();
    }

    @RequestMapping("/findByName")
    public UserLogin findByName(String username){
        return userLoginService.findByName(username);
    }



}

